package com.xinruke.hostels.support.controller;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.support.interfaces.dto.HotelDictAllQueryDTO;
import com.xinruke.hostels.support.interfaces.dto.SystemDictAllQueryResultDTO;
import com.xinruke.hostels.support.interfaces.dto.SystemDictQueryDTO;
import com.xinruke.hostels.support.service.HotelDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @author ChenXiangpeng
 * @ClassName HotelDictController
 * @date：2019/8/10
 * @version: V1.0.0
 * @description：
 */
@RestController
@RequestMapping("/hotel/dict")
@Api(tags = "酒店基础数据字典")
public class HotelDictController extends BaseController {
    @Autowired
    private HotelDictService hotelDictService;

    @PostMapping("/list")
    @ApiOperation("获取字典列表")
    public ResultVO<List<SystemDictAllQueryResultDTO>> getSystemDictList(@RequestBody @Valid HotelDictAllQueryDTO params) {
        return hotelDictService.getAllDict(params);
    }
}
